set(GTKLAUNCHER_DIR "${TOOLS_DIR}/GtkLauncher")
set(DERIVED_SOURCES_GTKLAUNCHER_DIR "${CMAKE_BINARY_DIR}/DerivedSources/GtkLauncher")

file(MAKE_DIRECTORY ${DERIVED_SOURCES_GTKLAUNCHER_DIR})

set(GtkLauncher_SOURCES
    #${DERIVED_SOURCES_GTKLAUNCHER_DIR}/BrowserMarshal.c
    #${GTKLAUNCHER_DIR}/BrowserCellRendererVariant.c
    #${GTKLAUNCHER_DIR}/BrowserCellRendererVariant.h
    #${GTKLAUNCHER_DIR}/BrowserDownloadsBar.c
    #${GTKLAUNCHER_DIR}/BrowserDownloadsBar.h
    #${GTKLAUNCHER_DIR}/BrowserSearchBar.c
    #${GTKLAUNCHER_DIR}/BrowserSearchBar.h
    #${GTKLAUNCHER_DIR}/BrowserSettingsDialog.c
    #${GTKLAUNCHER_DIR}/BrowserSettingsDialog.h
    #${GTKLAUNCHER_DIR}/BrowserTab.c
    #${GTKLAUNCHER_DIR}/BrowserTab.h
    #${GTKLAUNCHER_DIR}/BrowserWindow.c
    #${GTKLAUNCHER_DIR}/BrowserWindow.h
    ${GTKLAUNCHER_DIR}/main.c
)

set(GtkLauncher_INCLUDE_DIRECTORIES
    ${WEBKIT_DIR}/gtk
    ${WEBKIT_DIR}/gtk/webkit
    ${WebKit_INCLUDE_DIRECTORIES}
    ${DERIVED_SOURCES_GTKLAUNCHER_DIR}
    ${DERIVED_SOURCES_WEBKIT2GTK_DIR}
    ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
    ${FORWARDING_HEADERS_DIR}
    ${CMAKE_SOURCE_DIR}/Source
)

set(GtkLauncher_SYSTEM_INCLUDE_DIRECTORIES
    ${GTK3_INCLUDE_DIRS}
    ${GLIB_INCLUDE_DIRS}
    ${LIBSOUP_INCLUDE_DIRS}
)

set(GtkLauncher_LIBRARIES
    ${JavaScriptCore_LIBRARY_NAME}
    WebKit2
    ${GTK3_LIBRARIES}
    ${GLIB_LIBRARIES}
    ${LIBSOUP_LIBRARIES}
)

if (DEVELOPER_MODE)
    add_definitions(-DWEBKIT_INJECTED_BUNDLE_PATH="${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
endif ()

add_definitions(-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6)

include_directories(${GtkLauncher_INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${GtkLauncher_SYSTEM_INCLUDE_DIRECTORIES})
add_executable(GtkLauncher ${GtkLauncher_SOURCES})
target_link_libraries(GtkLauncher ${GtkLauncher_LIBRARIES})

#WEBKIT_ADD_TARGET_CXX_FLAGS(GtkLauncher -Wno-unused-parameter)

install(TARGETS GtkLauncher DESTINATION "${LIBEXEC_INSTALL_DIR}")
